<template>
	<view>
		<view class="uni-status-bar" style="background:rgba(233, 233, 233, 1)"></view>
		<view class="hb-header">
			<view class="left">
				<view class="uni-page-head-btn"><i class="uni-btn-icon" style="color: rgb(0, 0, 0); font-size: 27px;"
						@click="back"></i></view>
			</view>
			<view class="title">{{$t('index.newsDetail')}}</view>
			<view class="right">
			</view>
		</view>
		<view class="content pd15">
			<view class="title">
				<view class="handler">{{news.title}}</view>
				<view class="time">{{news.created_at}}</view>
			</view>
			<view class="paragraph" v-html="news.content">
			</view>
		</view>
	</view>
</template>

<script>
	import {newsDetail} from '@/api/home'
	import base64Code from '@/plugin/base64code';
	export default{
		data(){
			return{
				id:'',
				news:{}
			}
		},
		onLoad(e) {
			this.id = e.id
			// console.log(e.id,"e")
		},
		onShow() {
			
		},
		created() {
			this.getDetail()
		},
		methods:{
			//返回上一级
			back() {
				uni.navigateBack({
					delta: 1
				});
			},
			getDetail(){
				  var time = Math.round(new Date().getTime()/1000);
				  var data = {
					  id:base64Code.adds(time,this.id),
					  time:time
				  }
				 newsDetail(data).then(res=>{
					 if(res.code == 1000){
						 this.news =res.data
					 }
				 })
			}
		}
	}
</script>

<style scoped lang="scss">
	.hb-header {
		background: rgba(233, 233, 233, 1);
	}
	.content{
		.title{
			padding:32rpx;
			border-bottom:.5px solid $hb-border-color;
			text-align: center;
			.handler{
				font-size:32rpx;
				color: $hb-text-black-color;
				line-height:60rpx;
				margin-bottom:32rpx;
			}
			.time{
				font-size:24rpx;
				color: $hb-text-gray-color;
			}
		}
		.paragraph{
			font-size:32rpx;
			color: $hb-text-gray-color;
			padding:32rpx 0;
			line-height:56rpx;
		}
	}
</style>
